package com.gugee.ins.common.dal.mapper.blogger;


import com.gugee.common.mapper.GugeeMapper;
import com.gugee.ins.common.model.mysql.blogger.InsRelBloggerLocation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * ins 博主 地理位置 关系表 Mapper 接口
 * </p>
 *
 * @author HuangXin
 * @since 2021-01-05
 */
public interface InsRelBloggerLocationMapper extends GugeeMapper<InsRelBloggerLocation> {

    /**
     * 从帖子表插入
     * @param uid
     * @param timeLimit
     */
    @Insert("insert into ins_rel_blogger_location (uid,shortcode,location_id,location_name,create_time) " +
            " select t.owner_uid,t.shortcode,t.location_id,t.location_name,t.create_time from ins_media t " +
            " where t.owner_uid = #{uid} and t.taken_time > #{timeLimit} and location_id > 0")
    void insertByUidTimeLimit(@Param("uid")long uid,@Param("timeLimit") long timeLimit);
}
